// for语句重写 1到10的程序
#include <iostream>

int main()
{
    int sum = 0;
    for(int val = 1; val <= 10; ++val)
    {
        sum += val;
    }
    std::cout << "Sum of 1 to 10 is " << sum << std::endl;
    
    return 0;
}
